package com.wp.module.wpUserInstant.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.wp.module.wpUserInstant.domain.WpUserInteractVO;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wp.common.annotation.Log;
import com.wp.common.core.controller.BaseController;
import com.wp.common.core.domain.AjaxResult;
import com.wp.common.enums.BusinessType;
import com.wp.module.wpUserInstant.domain.WpUserInteract;
import com.wp.module.wpUserInstant.service.IWpUserInteractService;
import com.wp.common.utils.poi.ExcelUtil;
import com.wp.common.core.page.TableDataInfo;

/**
 * 操作类型Controller
 * 
 * @author wp
 * @date 2025-08-28
 */
@RestController
@RequestMapping("/module/wpUserInteract")
public class WpUserInteractController extends BaseController
{
    @Autowired
    private IWpUserInteractService wpUserInteractService;

    /**
     * 查询操作类型列表
     */
    @PreAuthorize("@ss.hasPermi('module:wpUserInteract:list')")
    @GetMapping("/list")
    public TableDataInfo list(WpUserInteractVO wpUserInteract)
    {
        startPage();
        List<WpUserInteractVO> list = wpUserInteractService.selectWpUserInteractList(wpUserInteract);
        return getDataTable(list);
    }

    /**
     * 导出操作类型列表
     */
    @PreAuthorize("@ss.hasPermi('module:wpUserInteract:export')")
    @Log(title = "操作类型", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, WpUserInteractVO wpUserInteract)
    {
        List<WpUserInteractVO> list = wpUserInteractService.selectWpUserInteractList(wpUserInteract);
        ExcelUtil<WpUserInteractVO> util = new ExcelUtil<WpUserInteractVO>(WpUserInteractVO.class);
        util.exportExcel(response, list, "操作类型数据");
    }

    /**
     * 获取操作类型详细信息
     */
    @PreAuthorize("@ss.hasPermi('module:wpUserInteract:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(wpUserInteractService.selectWpUserInteractById(id));
    }

    /**
     * 新增操作类型
     */
    @PreAuthorize("@ss.hasPermi('module:wpUserInteract:add')")
    @Log(title = "操作类型", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody WpUserInteract wpUserInteract)
    {
        return toAjax(wpUserInteractService.insertWpUserInteract(wpUserInteract));
    }

    /**
     * 修改操作类型
     */
    @PreAuthorize("@ss.hasPermi('module:wpUserInteract:edit')")
    @Log(title = "操作类型", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody WpUserInteract wpUserInteract)
    {
        return toAjax(wpUserInteractService.updateWpUserInteract(wpUserInteract));
    }

    /**
     * 删除操作类型
     */
    @PreAuthorize("@ss.hasPermi('module:wpUserInteract:remove')")
    @Log(title = "操作类型", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(wpUserInteractService.deleteWpUserInteractByIds(ids));
    }
}
